package com.ambimmort.shj.action.device.td;

import com.ambimmort.shj.service.device.TdDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by zyt on 2015/7/30.
 */

@Controller("/action/AddTddevice.do")
public class AddTddevice {
    @Autowired
    private TdDeviceService tdDeviceService;

    @RequestMapping("/action/AddTddevice.do")
    @ResponseBody
    public boolean action_device(
            HttpServletRequest request, @RequestParam("local_ip") String ip, @RequestParam("local_port") String port, @RequestParam("local_user") String local_user, @RequestParam("local_pswd") String pswd, @RequestParam("freq") String freq, @RequestParam("local_path") String local_path, @RequestParam("desc") String desc, @RequestParam("up2_ip") String up2ip, @RequestParam("up2_port") String up2port, @RequestParam("up2_user") String up2user, @RequestParam("up2_pswd") String up2pswd) {
        return tdDeviceService.addTddeviceDevice(ip, port, local_user, pswd, freq, local_path, desc, up2ip, up2port, up2user, up2pswd);
    }
}